package ils.domain.issue.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
@Entity
@Table(name="issues")
public class Issue
{
    private Integer id;
    private Integer userId;
    private Item item;
    private Date issueDate;
    private Date dueDate;
    private Date renewDate;
    private Integer renewalCount;
    private Date returnDate;
    private Integer issueBranchId;

    @Id
    @GeneratedValue(generator="increment")
    @GenericGenerator(name="increment", strategy="increment")
    public Integer getId()
    {
        return id;
    }
    public void setId(Integer id)
    {
        this.id = id;
    }
    public Integer getUserId()
    {
        return userId;
    }
    public void setUserId(Integer userId)
    {
        this.userId = userId;
    }
    @ManyToOne(cascade={CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH})
    @JoinColumn(name="itemId")
    public Item getItem()
    {
        return item;
    }
    public void setItem(Item item)
    {
        this.item = item;
    }
    public Date getIssueDate()
    {
        return issueDate;
    }
    public void setIssueDate(Date issueDate)
    {
        this.issueDate = issueDate;
    }
    public Date getDueDate()
    {
        return dueDate;
    }
    public void setDueDate(Date dueDate)
    {
        this.dueDate = dueDate;
    }
    public Date getRenewDate()
    {
        return renewDate;
    }
    public void setRenewDate(Date renewDate)
    {
        this.renewDate = renewDate;
    }
    public Integer getRenewalCount()
    {
        return renewalCount;
    }
    public void setRenewalCount(Integer renewalCount)
    {
        this.renewalCount = renewalCount;
    }
    public Date getReturnDate()
    {
        return returnDate;
    }
    public void setReturnDate(Date returnDate)
    {
        this.returnDate = returnDate;
    }

    public Integer getIssueBranchId() {
        return issueBranchId;
    }

    public void setIssueBranchId(Integer issueBranchId) {
        this.issueBranchId = issueBranchId;
    }
}
